<template>
	<view class="mainpadding">
		<view class="ffffff radius mainpadding flexbetween">
			<view class="ershiba zhonghei fonweight">快递公司</view>
			<input class="textright" placeholder="请输入快递公司名称" type="text" v-model="express_name"/>
		</view>
		<view class="ffffff radius mainpadding flexbetween margin_top">
			<view class="ershiba zhonghei fonweight">快递单号</view>
			<input class="textright" placeholder="请输入快递单号" type="text" v-model="express_no"/>
		</view>
		<view class="gudingdb mainpadding">
			<view class="bigbtn" @click="submit">提交</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid:"",
				express_name:"",
				express_no:"",
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.orderTklx()//物流
		},
		methods: {
			submit(){
				if(this.express_name==""){
					httpRequest.toast("请输入快递公司名称")
					return false
				}
				if(this.express_no==""){
					httpRequest.toast("请输入快递单号")
					return false
				}
				httpRequest.request('/api/order/toExpress', 'POST', {
					id:this.listid,
					express_name:this.express_name,
					express_no:this.express_no
				}).then(res => {
					httpRequest.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				})
			},
			confirm(e){
				this.reason = e.value[0].name
				this.show=false
			},
			orderTklx(){//退款理由
				httpRequest.request('/api/order/orderTklx', 'GET', {
				}).then(res => {
					this.columns.push(res.data)
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.textarea{
	height: 100rpx;
}
</style>
